@echo off
echo Initializing Git repository...
cd /d "C:\Users\Administrator\Documents\trae_projects\lt00001\magazine"

REM Try to find git.exe
set GIT_CMD=
if exist "C:\Program Files\Git\cmd\git.exe" (
    set GIT_CMD="C:\Program Files\Git\cmd\git.exe"
) else if exist "C:\Program Files (x86)\Git\cmd\git.exe" (
    set GIT_CMD="C:\Program Files (x86)\Git\cmd\git.exe"
) else (
    echo Git not found in standard locations
    pause
    exit /b 1
)

echo Using Git at: %GIT_CMD%
echo.

REM Initialize repository
%GIT_CMD% init
echo.

REM Configure user
%GIT_CMD% config user.name "Magazine Admin"
%GIT_CMD% config user.email "admin@magazine.local"
echo.

REM Add all files
%GIT_CMD% add .
echo.

REM Commit
%GIT_CMD% commit -m "Initial commit: Add simple image upload functionality"
echo.

echo Git repository initialized successfully!
echo.
echo To push to a remote repository, run:
echo %GIT_CMD% remote add origin https://gitee.com/yourusername/magazine.git
echo %GIT_CMD% push -u origin main
echo.
pause